CC=gcc
CXX=g++
CPPFLAGS=
DODOMET=/home/dodo/code/dodomet_cpp
LIB_DODO_PLOT=-I$(DODOMET)/dodo_plot/src
LIB_CAIRO=-I/usr/include/cairo -I/usr/include/cairomm-1.0 -I/usr/include/sigc++-2.0 -lcairomm-1.0 -lcairo
LIB_BOOST=
LIB_SHAPE=-I$(DODOMET)/dodo_plot/include/shapelib -L$(DODOMET)/dodo_plot/lib -lshapelib

COMPILED_LIB=-I$(DODOMET)/dodo_plot/include -L$(DODOMET)/dodo_plot/lib -ldodo_plot-alpha


ALL_H = ../dodo_plot.h \
	../kernel/basic_elements.h \
	../kernel/point.h \
	../kernel/position.h \
	../kernel/color.h \
	../kernel/font.h \
	../kernel/colormap.h \
	../kernel/basic_utils.h \
	../kernel/operation.h \
	../kernel/canvas.h \
	../kernel/combi_pic.h \
	../kernel/frame_pic.h \
	../kernel/pic.h  \
	../kernel/picture.h  \
	../kernel/plotfwd.h  \
	../kernel/p_node.h \
	../widget/cross.h \
	../widget/blank.h \
	../widget/label.h \
	../widget/axis.h \
	../widget/plot.h \
	../widget/plot.tcc \
	../widget/image.h \
	../widget/image.tcc \
	../projector/linear_2d_projector.h \
	../map/lambert.h
	
ALL_CPP = ../kernel/point.cpp \
	  ../kernel/position.cpp \
	../kernel/basic_utils.cpp \
	../kernel/operation.cpp \
	../kernel/canvas.cpp \
	../kernel/combi_pic.cpp \
	../kernel/frame_pic.cpp \
	../kernel/picture.cpp  \
	../kernel/p_node.cpp \
	../widget/cross.cpp \
	../widget/axis.cpp \
	../widget/label.cpp\
	../widget/image.cpp \
	../widget/blank.cpp \
	../map/lambert.cpp

test_cross : test_cross.cpp $(ALL_H) $(ALL_CPP)
	$(CXX) $(CPPFLAGS) test_cross.cpp -o test_cross $(LIB_DODO_PLOT) $(COMPILED_LIB) $(LIB_CAIRO) -lm

test_axis : test_axis.cpp $(ALL_H) $(ALL_CPP)
	$(CXX) $(CPPFLAGS) test_axis.cpp ../widget/axis.cpp  -o test_axis $(LIB_DODO_PLOT) $(COMPILED_LIB) $(LIB_CAIRO) -lm

test_plot : test_plot.cpp $(ALL_H) $(ALL_CPP)
	$(CXX) $(CPPFLAGS) test_plot.cpp ../widget/plot.cpp ../widget/blank.cpp ../widget/axis.cpp -o test_plot $(LIB_DODO_PLOT) $(COMPILED_LIB) $(LIB_CAIRO) -lm
#test_map : test_map.cpp $(ALL_H) $(ALL_CPP)
#	$(CXX) $(CPPFLAGS) $(ALL_CPP) test_map.cpp -o test_map $(LIB_DODO_PLOT) $(LIB_CAIRO)
test_map : test_map.cpp $(ALL_H) ../map/map_data.cpp ../map/map_data.h ../map/map.h ../map/map.tcc ../map/lambert.cpp ../map/map_grid.h ../map/map_grid.tcc ../map/map_utils.h
	$(CXX) $(CPPFLAGS) test_map.cpp ../map/map_data.cpp ../map/lambert.cpp -o test_map $(LIB_DODO_PLOT) $(COMPILED_LIB) $(LIB_SHAPE) $(LIB_CAIRO) -lm

test_china_map : test_china_map.cpp $(ALL_H) ../map/map_data.cpp ../map/map_data.h ../map/map.h ../map/map.tcc ../map/lambert.cpp ../map/map_grid.h ../map/map_grid.tcc ../map/map_utils.h
	$(CXX) $(CPPFLAGS) test_china_map.cpp ../map/map_data.cpp ../map/lambert.cpp -o test_china_map $(LIB_DODO_PLOT) $(COMPILED_LIB) $(LIB_SHAPE) $(LIB_CAIRO) -lm

test_worldmap : test_worldmap.cpp $(ALL_H) ../map/map_data.cpp ../map/map_data.h ../map/map.h ../map/map.tcc  ../map/map_grid.h ../map/map_grid.tcc ../map/map_utils.h ../map/plain_projection.h ../map/plain_projection.cpp
	$(CXX) $(CPPFLAGS) test_worldmap.cpp ../map/map_data.cpp ../map/plain_projection.cpp -o test_worldmap $(LIB_DODO_PLOT) $(COMPILED_LIB) $(LIB_SHAPE) $(LIB_CAIRO) -lm

test_colormap : test_colormap.cpp ../kernel/color.h ../kernel/colormap.h ../kernel/color.cpp
	$(CXX) $(CPPFLAGS) test_colormap.cpp ../kernel/color.cpp -o test_colormap $(LIB_DODO_PLOT) -lm

test_image : test_image.cpp $(ALL_H) $(ALL_CPP) ../widget/colorbar.h ../widget/colorbar.cpp
	$(CXX) $(CPPFLAGS) test_image.cpp ../widget/colorbar.cpp -o test_image $(LIB_DODO_PLOT) $(COMPILED_LIB) $(LIB_CAIRO) -lm

test_symbol : test_symbol.cpp $(ALL_H) $(ALL_CPP) ../symbol/symbol_base.h ../symbol/plus_symbol.h ../symbol/arrow_symbol.h ../widget/vector_field.h
	$(CXX) $(CPPFLAGS) test_symbol.cpp -o test_symbol $(LIB_DODO_PLOT) $(COMPILED_LIB) $(LIB_CAIRO) -lm
